package types;
import carnet.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import exceptions.*;

public class ChampTel extends ChampString{
	
	public boolean Check() throws Exception {
		return CheckTelephone(this);
	}
	
	private boolean CheckTelephone(ChampTel c) {
		if(c.valeur.length() == 10){
			Pattern p = Pattern.compile("[0-9]*");
			Matcher m = p.matcher(c.valeur);
			return m.matches();
		}
		return false;
	}
}